#include <stdio.h>
#include <arraylist.h>
#include <linkedlist.h>

void TestArrayList() {
	ArrayList myList;
	ArrayListIterator it;
	
	int i;
	
	myList = AL_New(10);
	
	for (i=50; i < 60; i++) {
		AL_Add(myList, AL_Begin(myList), (void *)i);
		AL_Add(myList, AL_End(myList), (void *)i);
	} 
	
	printf("Lista cu vectori:\n");
	for (it = AL_Begin(myList); it != AL_End(myList); it = AL_Next(myList, it)) {
		printf("%d ", (int)AL_Get(myList, it));
	}
	printf("\n");
	
	AL_Free(myList);
	myList = NULL;
}

void TestLinkedList() {
	LinkedList myList;
	LinkedListIterator it;
	
	int i;
	
	myList = LL_New();
	
	for (i=30; i < 40; i++) {
		LL_Add(myList, LL_End(myList), (void *)i);
		LL_Add(myList, LL_Begin(myList), (void *)i);
	}
	
	printf("Lista dublu inlantuita:\n");
	for (it = LL_Begin(myList); it != LL_End(myList); it = LL_Next(myList, it)) {
		printf("%d ", (int)LL_Get(myList, it));
	}
	printf("\n");
	
	LL_Free(myList);
	myList = NULL;
}

int main(int argc, char **argv) {
	TestArrayList();
	
	TestLinkedList();
	
	return 0;
}
